public class LockY {
    private Object object = new Object();
    public void m1(){
        synchronized (object){
            System.out.println("m1:"+Thread.currentThread().getId()+"run...");
            m2();
        }
        System.out.println("m1:" +Thread.currentThread().getId()+"退出");
    }
    public void m2(){
        synchronized (object){
            System.out.println("m2:"+Thread.currentThread().getId()+"run...");
        }
        System.out.println("m2:"+Thread.currentThread().getId()+"退出");
    }
}
